from libs.exception import BaseHTTPException
from flask_babel import gettext as _

class HTTPEmojiCreateParamError(BaseHTTPException):
    error_code = "emoji_create_param_error"
    code = 400
    def __init__(self, message:str|None=""):
        self.description = _("Create emoji parameter error. {message}").format(message=message)
        super().__init__(self.description)

class HTTPEmojiNotExistError(BaseHTTPException):
    error_code = "emoji_not_exist_error"
    code = 400
    def __init__(self, emoji_id:str=""):
        self.description = _("Emoji not exist. {emoji_id}").format(emoji_id=emoji_id)
        super().__init__(self.description)

class HTTPEmojiPackCreateParamError(BaseHTTPException):
    error_code = "emoji_pack_create_param_error"
    code = 400
    def __init__(self, message:str|None=""):
        if message:
            self.description = f"{_("Create emoji package parameter error.")}{message}"
        else:
            self.description = _("Create emoji package parameter error.")
        super().__init__(self.description)

class HTTPEmojiPackNotExistError(BaseHTTPException):
    error_code = "emoji_pack_not_exist_error"
    code = 400
    def __init__(self, emoji_pack_id:str=""):
        self.description = _("Emoji package not exist. {emoji_pack_id}").format(emoji_pack_id=emoji_pack_id)
        super().__init__(self.description)